<template>
  <div class="query">
    <span class="logo">
      <el-tooltip class="item" effect="dark" content="菜单" placement="bottom">
        <i class="iconfont icon-hanbao" @click="contentVisible = !contentVisible"></i>
      </el-tooltip>
    </span>
    <div class="header title">
      <p>&nbsp;&nbsp;&nbsp;基层数据查询</p>
      <el-button size="mini" @click="openQueryResult" v-if="status.isHasMicroSearch">查询结果</el-button>
    </div>
    <div class="content" v-show="contentVisible">
      <div>
        <!-- 对象表 -->
        <div class="report-box">
          <p>数据对象:</p>
          <el-select
            v-model="tableObj.selected.name"
            size="small"
            placeholder="请选择"
            popper-class="tableObjPopper"
            ref="selectTableObj"
            @click.native="showTableObjTree = !showTableObjTree"
          >
            <el-option
              :key="tableObj.selected.id"
              :label="tableObj.selected.name"
              :value="tableObj.selected.id"
            ></el-option>
          </el-select>
          <el-tree
            v-show="showTableObjTree"
            ref="tableObjTree"
            node-key="id"
            :props="tableObj.defaultProps"
            :data="tableObj.tableObjData"
            lazy
            class="tableObjTreePopper"
            @node-click="tableObjNodeClick"
            @node-expand="tableObjNodeExpand"
          ></el-tree>
        </div>
        <!-- 对象表 -->
        <!-- 报告期 -->
        <div class="report-box">
          <p>报告期:</p>
          <el-select
            v-model="report.reportvalue"
            placeholder="请选择"
            size="small"
            popper-class="report_select_popper"
            class="report_input"
            :disabled ="status.periodStatus"
          >
            <el-option
              v-for="(item,index) in report.reportoptions"
              :key="index"
              :label="item.allName"
              :value="item.allName"
            ></el-option>
          </el-select>
        </div>
        <!-- 报告期 -->
        <el-input
          placeholder="请输入关键字"
          v-model="quicksearchvalue"
          @keyup.enter.native="searchData"
          size="small"
          class="micro-search-input"
        >
          <el-button
            class="micro-search-btn"
            slot="append"
            :select-when-unmatched="true"
            icon="el-icon-search"
            @click="searchData"
          ></el-button>
        </el-input>
        <el-tabs
          v-model="activeName"
          type="card"
          @tab-click="tabhandleClick"
          :before-leave="tabhandleClickBefore"
        >
          <el-tab-pane label="分类查询" name="classifiedquery" >
            <div class="classifiedquery">
              <el-collapse
                v-model="collapse.collapseActiveNames"
                accordion
                @change="collapseHandleChange"
              >
                <el-collapse-item
                  v-for="(item,index) in classified_query_item"
                  :key="index"
                  :title="item.name"
                  :name="index"
                >
                  <div>
                    <div class="classifiedquert_container">
                      <el-tree
                        :ref="item.id"
                        class="classifiedqueryTree"
                        node-key="id"
                        :data="item.data"
                        :props="collapse.identreeprops"
                        show-checkbox
                        :check-strictly="true"
                        @node-expand="identTreeLoadNode"
                        @check-change="(obj,status)=>identTreeCheckChange(obj,status,item,index)"
                      ></el-tree>
                    </div>
                  </div>
                </el-collapse-item>
              </el-collapse>

              <div class="classSearchBox">
                <el-button type="primary" @click="classifiedQueryData">查询</el-button>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="行业门类" name="tradeCode">
            <div class="tradeCodeContent">
              <el-tree
                ref="tradeCodeTree"
                class="classifiedqueryTree"
                node-key="id"
                :data="tradeCode.treeData"
                :props="tradeCode.treeprops"
                show-checkbox
                :check-strictly="true"
                @node-expand="tradeCodeTreeLoadNode"
                @check-change="tradeCodeTreeCheckChange"
              ></el-tree>
              <div class="classSearchBox">
                <el-button type="primary" @click="classifiedQueryData">查询</el-button>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="补充条件" name="macroquery" >
            <div class="macroquery">

              <p class="searchtitle">常用收藏条件：</p>
              <div class="searchlist-box">
                <ul v-for="(item,index) in saveTermData" :key="index">
                  <li>
                    <p @click="searchlisthander_click(item)" @dblclick="searchlisthander_dblclick(item)" >
                      <i class="el-icon-search"></i>
                      {{item.title}}
                    </p>
                    <i class="el-icon-close" @click="deleteachievement(item,index)"></i>
                  </li>
                </ul>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>

        <macroquerypanel
          v-show="showmacroqueryall"
          :maintableinfo="tableObj.selected"
          :reportvalue="report.selectedValue"
          :collapsemainconditions="collapse.colmainconditions"
          @search_macro="search_macro"
          @update_SaveTerm="getSaveTerm"
        ></macroquerypanel>
      </div>
    </div>

    <queryresultpanel
      v-show="showMicroQueryResult"
      :hasaddterm="hasaddterm"
      :microsearchargs="microsearchargs"
      @changeMicroSearchStatus="changeMicroSearchStatus"
      :selectedId="tableObj.selected.id"
    ></queryresultpanel>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
import macroquerypanel from "./macroquerypanel.vue"; //综合查询条件组装面板
import queryresultpanel from "./queryResult.vue"; //基层查询结果面板

import sgisRegionBase from "@/utils/map/sfgis.region.base.js";
import sgisMapBase from "@/utils/map/sfgis.map.base.js";
import Layer from "@/utils/map/lib/main.js"; // 专题图层绘画函数
import searchresultData from "./searchresult.data.js";
import axios from "axios";
import authority from "static/js/authority.js";
import { setTimeout } from "timers";
import mapPopup from '@/utils/map/lib/common/map.popup.js';
import * as microAPI from "@/pages/micro/api/micro.js";
import microConfig from "static/config/micro.js";
import query from "static/config/query.js";

export default {
  name: "Query",
  components: {
    macroquerypanel,
    queryresultpanel
  },
  props: ["hideTableObjTree"],
  data() {
    return {
      quicksearchvalue: "", //搜索条件值
      contentVisible: false, //控制空间查询面板展开与隐藏
      style: {}, //查询面板样式
      classifiedData: [],
      report:{//报告期参数
        reportoptions: [], //报告期数据选项
        reportvalue: "", //报告期选中值
        selectedValue:{}//选中对象
      },
    

      tableObj: {
        //表对象
        selected: {
          id: "",
          name: ""
        }, //选中表
        tableObjData: [], //所有的表树数据
        defaultProps: {
          children: "children",
          label: "name",
          isLeaf: "isLeaf"
        }
      },
      showTableObjTree: false,
      activeName: "classifiedquery", //选项卡选中值

      status: {
        //控制左边查询组件的展示隐藏
        blurrysearchresult: false, //控制查询结果表格展示与否
        isClear: false, //是否被清空，清空时区划和等级变更不执行查询
        isHasMicroSearch: false, //记录是否有进行过基层查询
        periodStatus:true,//报告期状态
        isFirstSearchTableTree:true,//是否第一次渲染对象树
        isdb:false//是否是双击
      },
      microsearchargs: {}, //查询参数

      saveTermData: [], //收藏条件
      //分页相关-条件查询
      pagination: {
        pagesize: microConfig.table.pagesize, //每页大小
        total: 0, //总数
        pagenum: 1 //当前页
      },
      regions: {
        //区划
        rcid: config.regions.rcid, // 区划版本配置
        regionCodeType: 1, //行政区划类型
        regionArr: [
          {
            regionCode: config.regions.regionCode,
            regionLevel: config.regions.regionLevel,
            regionName: config.regions.regionName
          }
        ]
      },
      hasaddterm: {
        conditions: [],
        msConditions: []
      }, //存储查询条件

      microPower: [], //基层权限
      Authorization: "", //token
      typetabstyle: {
        //地图、图表、表格切换组件样式
        width: "calc(100vw - 301px)",
        left: "301px",
        activeName: "tongjitu"
      },

      classified_query: query.classified_query,
      classified_query_item: [], //分类查询数据
      classified: "", //选择分类
      collapse: {//分类查询折叠面板参数
        collapseActiveNames: "0",
        fleldData: {},
        lastActiveIndex: -1, //上一次展开的面板
        colmainconditions: [], //存放组装的值，给补充条件
        identreeprops: {//分组值树
          label: "label",
          children: "children",
          isLeaf: "leaf"
        },
        firstLevel:1//初始深度
      },

      tradeCode: {//行业门类
        selectCode:[],//选中的行业大类代码
        data: {}, //原始保存数据
        treeData: [], //树数据
        checkList: [], //选中项
        treeprops: {
          label: "label",
          children: "children",
          isLeaf: "leaf"
        },
        firstLevel:1//初始深度
      }
    };
  },
  computed: {
    ...mapState({
      showmacroqueryall: state => state.micro.showmacroqueryall,
      showFastCollectLayer: state => state.micro.showFastCollectLayer,
      showTypeTabLayer: state => state.micro.showTypeTabLayer,
      showTableLayer: state => state.micro.showTableLayer,
      showMicroQueryResult: state => state.micro.showMicroQueryResult
    })
  },
  watch: {
    contentVisible() {
      if (!this.contentVisible) {
        this.style = {
          height: "60px"
        };
      } else {
        this.style = {
          height: "100%"
        };
      }
      this.$emit("querystyle", this.style);
    }
  },
  mounted() {
    let that = this;
    //获取权限方法
    var userInfo = localStorage.getExpire("userInfo");
    var token_type = localStorage.getExpire("token_type");
    var access_token = localStorage.getExpire("access_token");

    if (userInfo && token_type && access_token) {
      that.Authorization = token_type + " " + access_token;
      that.microPower = JSON.parse(userInfo).permissions;

      this.getRootMicroMenu();
    }
    EventBus.$on("updateRegions", this.updateRegions);
    EventBus.$on("getBuildDWList", this.getBuildDWList);
  },
  beforeDestroy() {
    EventBus.$off("updateRegions", this.updateRegions);
  },
  methods: {
    ...mapMutations([
      "changeshowmacroqueryall",
      "changeShowFastCollectLayer",
      "changeShowTypeTabLayer",
      "changeShowTableLayer",
      "changeShowMicroQueryResult",
      "changeDetailViewData"
    ]),
    //根据建筑物编码查询单位列表
    getBuildDWList(buildCode,latlon){
      let that = this;
      let microId = that.tableObj.selected.id;
      if(microId){
        let req = {
          buildCode : buildCode,
          microId : microId
        }
        microAPI
          .getBuildDWList(req)
          .then(response => {
            if (response.message == "success") {
              let data = response.data;
              // if(data.length>0){
                let buildData = {
                  dataList:data,
                  latlon:latlon
                }
                mapPopup.openBuildPopup(buildData,function(){
                  $('.marker-popup-build-map ul li').click((e) => {
                    let id = (e.target).id;
                    that.getDWInfo(id);
                  })
                });
              // }
            }else {
              that.$message({
                message: response.message,
                type: "error"
              });
              return;
            }
          })
          .catch(error => {
            console.log(error);
          });
      }else{
        that.$message({
          message: "请先选择数据对象",
          type: "error"
        });
      }

    },
    getDWInfo(id){
      let that = this;
      let microId = that.tableObj.selected.id;
      if(microId){
        let req = {
          id  : id ,
          microId : microId
        }
        microAPI
          .getBuildDWInfo(req)
          .then(response => {
            if (response.message == "success") {
              let data = response.data;
              let DWInfo = {
                head:data.head,
                content:{
                  records:[]
                }
              }
              DWInfo.content.records.push(data.content);
              let markdata = searchresultData.initMarkerData(DWInfo);

              //打开详情面板
              that.$store.commit("changeDetailViewLayer", true);
              that.$store.commit("changeDetailViewData", markdata[0].data);
            }else {
              that.$message({
                message: response.message,
                type: "error"
              });
              return;
            }
          })
          .catch(error => {
            console.log(error);
          });
      }else{
        that.$message({
          message: "请先选择数据对象",
          type: "error"
        });
      }

    },
    getRootMicroMenu() {
      let that = this;
      let req = {
        menu_id: "root"
      };
      this.getMicroMenu(req, function(data) {
        that.tableObj.tableObjData = data;
        that.tableObjNodeExpand(that.tableObj.tableObjData[0]);
      });
    },
    getMicroMenu(req, callback) {
      microAPI
        .metaMenu(req)
        .then(res => {
          if (res.message == "success") {
            let data = res.data;
            for (let i in data) {
              data[i].children = [];
              data[i].type = "menu";
              data[i].isLeaf = false;
            }
            callback(data);
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    getMicroTable(req, callback) {
      microAPI
        .microTable(req)
        .then(res => {
          if (res.message == "success") {
            let data = res.data.records;
            for (let i in data) {
              data[i].children = [];
              data[i].type = "tableObj";
              data[i].isLeaf = true;
            }
            callback(data);
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    tableObjNodeExpand(node, resolve) {
      let that = this;
      if (node.children.length < 1) {
        if (node.type != "tableObj") {
          let req = {
            menu_id: node.id
          };
          let tableObjReq = {
            current: 1,
            menu_id: node.id,
            size: 1000,
            meta_type: "",
            report_type: ""
          };
          that.getMicroMenu(req, function(menudata) {
            let arr = menudata;
            that.getMicroTable(tableObjReq, function(tableObjData) {
              arr.push(...tableObjData);
              if (arr.length == 0) {
                node.isLeaf = true;
              }else{
                if(that.status.isFirstSearchTableTree){
                  let defaultTableTreeSelect = microConfig.defaultTableTreeSelect;
                  for(let i in arr){
                    if(arr[i].name == defaultTableTreeSelect){
                      that.tableObjNodeClick(arr[i]);
                    }
                  }
                }
              }
              node.children = arr;
            });
          });
        } else {
          node.children = [];
        }
      }
    },
    //数据对象树点击
    tableObjNodeClick(node) {
      let that = this;
      if (node.type == "tableObj") {
        sessionStorage.setItem("selectedObjTable",JSON.stringify(node));
        that.tableObj.selected = node;
        that.showTableObjTree = false;
        that.$refs.selectTableObj.blur();
        that.getMicroIden(node);
        that.getReportTime();
        that.getSaveTerm();
        this.classifiedData = [];

        //初始分类查询折叠面板参数
        that.collapse.collapseActiveNames = "0";
        that.collapse.lastActiveIndex = -1;
        that.collapse.fleldData = {};
        that.collapse.colmainconditions = [];

        //清空行业代码（归类）配置参数
        that.tradeCode.treeData = [];
        that.tradeCode.data = [];
        that.tradeCode.checkList = [];
        that.tradeCode.selectCode = [];
      }
    },

    //查询表指标(分类查询枚举指标)
    getMicroIden(node) {
      let that = this;
      let req = {
        miid: node.id,
        iden_type: 4
      };
      microAPI
        .getSelectedTableIden(req)
        .then(res => {
          if (res.message == "success" && res.data.length > 0) {
            let arr = res.data;
            let newArr = [];
            arr.map(item => {
              if (item.idenAliasCode != "HYDM") {
                item.name = item.idenName;
                item.data = [];
                item.checkList = [];
                newArr.push(item);
              } else if (item.idenAliasCode == "HYDM") {
                item.name = item.idenName;
                item.data = [];
                item.checkList = [];
                that.initTradeCode(item);
              }
            });
            that.classified_query_item = newArr;

            for (let i in that.classified_query_item) {
              this.classifiedQuery(that.classified_query_item[i], i);
            }
            this.collapse.collapseActiveNames = "0";
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    //查询表的报告期信息
    getReportTime() {
      let that = this;
      that.status.periodStatus = true;
      that.report.reportoptions = [];
      that.report.reportvalue = "";
      let args = {
        mitmid: that.tableObj.selected.id
      };
      microAPI
        .selectedPeriod(args)
        .then(res => {
          if (res.message == "success" && res.data.length > 0) {
            that.report.reportoptions = res.data;
            that.report.reportvalue = that.report.reportoptions[0].allName;
            that.status.periodStatus = false;
          }
        })
        .catch(res => {
          console.log(res);
        });
    },
    //折叠面板改变更新
    collapseHandleChange(val) {
      let that = this;
      let index = val.toString();
      if (that.collapse.lastActiveIndex == -1 && index != "") {
        //第一次展开
        that.collapse.lastActiveIndex = val;
      } else if (that.collapse.lastActiveIndex != -1 && index != "") {
        //切换
        that.collapse.lastActiveIndex = val;
      } else if (that.collapse.lastActiveIndex != -1 && index == "") {
        //关闭
      }
    },
    //初始行业门类-行业代码
    initTradeCode(item) {
      let that = this;
      that.tradeCode.data = item;
      let req = {
        mid: item.identid,
        vid: item.identVersion
      };
      that.getClassifiedList(req, function(data) {
        that.tradeCode.data.data = data;
      });
    },
    //更新区划
    updateRegions(tagsdata) {
      let that = this;
      let regionsArr = [];
      for (let i = 0; i < tagsdata.length; i++) {
        let level = sgisRegionBase.regionUtils.getRegionLevel(
          tagsdata[i].regionCode || tagsdata[i].code
        );
        regionsArr.push({
          regionCode: tagsdata[i].regionCode || tagsdata[i].code, //区划代码
          regionName: tagsdata[i].name || tagsdata[i].shortName || "", //区划名称
          regionLevel: level //当前区划等级
        });
      }
      that.regions.rcid = config.regions.rcid;//更新版本
      that.regions.regionArr = regionsArr;
      if (!that.status.isClear && that.hasaddterm.conditions.length > 0) {
        that.pagination.pagenum = 1;
      }
    },
    //左边菜单切换
    tabhandleClick(tab, event) {
      if (tab.name == "macroquery") {
        if (this.tableObj.selected.id != "") {
          this.$store.commit("changeshowmacroqueryall", true);
        } else {
          return;
        }
      } else {
        this.$store.commit("changeshowmacroqueryall", false);
      }
    },
    tabhandleClickBefore(activeName, oldActiveName) {
      let result = true;
      if (activeName == "macroquery" && this.tableObj.selected.id == "") {
        this.$message({
          message: "请先选择数据对象",
          type: "warning"
        });
        result = false;
      }
      return result;
    },
    changeTabHandle(activeModule) {
      this.activeName = activeModule;
      if (this.activeName == "macroquery") {
      } else {
      }
    },
    //查询收藏条件
    getSaveTerm() {
      let that = this;
      let args = {
        mitmid: that.tableObj.selected.id,
        type: 1 //1=收藏条件
      };
      microAPI
        .queryAchievement(args)
        .then(res => {
          if (res.message == "success") {
            that.saveTermData = res.data;
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    //分类查询(枚举分组值第一层查询)
    classifiedQuery(ident, index) {
      let that = this;
      let req = {
        mid: ident.identid,
        vid: ident.identVersion
      };
      that.classified_query_item[index].fleldData =
        that.classified_query_item[index];
      that.getClassifiedList(req, function(data) {
        if(data.length>0){
          let childArr = JSON.parse(JSON.stringify(data));
          let first = {
            label: "选择所有",
            code: "all",
            id:"all-"+ident.id,
            level: that.collapse.firstLevel,
            includes:childArr
          }
          for(let i in data){
            data[i].level = that.collapse.firstLevel;
          }
          data.unshift(first)
          that.classified_query_item[index].data = data;
        }
      });
    },
    //分类查询指标值（分组值）
    getClassifiedList(req, callback) {
      let that = this;
      microAPI.selectRoot(req).then(res => {
        if (res.message == "success") {
          let data = res.data;
          for (let i in data) {
            data[i].label = data[i].code + " "+data[i].name;
            if (data[i].hasChild != 0) {
              data[i].leaf = false;
              data[i].children = [{}];
            }
          }
          callback && callback(data);

          // if(data.length){
          //   if(that.classified == "DJZC" || that.classified == "HYDL" || that.classified == "QYKG"){
          //     data.map(item=>{
          //       if(item.code == "0"){
          //         item.imgUrl = "static/images/classification-icon/circle.png"
          //       }else{
          //         item.imgUrl = "static/images/classification-icon/" + that.classified + "-" + item.code + ".png"
          //       }
          //       return item
          //     })
          //   }else{
          //     data.map(item=>{
          //       item.imgUrl = "static/images/classification-icon/circle.png"
          //     })
          //   }
          // }
          // this.classifiedData = data.sort(function(s,t){
          //   let a = s.code.toLowerCase();
          //   let b = t.code.toLowerCase();
          //   if (a < b) return -1;
          //   if (a > b) return 1;
          //   return 0;
          // });
          // this.classifiedData.unshift({name:"全部",id:0,imgUrl:"static/images/classification-icon/circle.png"})
        }
      });
    },
    //分类查询-分组值树懒加载数据
    identTreeLoadNode(obj, node, resolve) {
      let that = this;
      if (!obj.children[0].hasOwnProperty("id")) {
        //防止重复请求子节点
        let req = {
          mid: obj.mid,
          vid: obj.vid,
          parcode: obj.code
        };
        that.getClassifiedList(req, function(data) {
          if(data.length>0){
            let childArr = JSON.parse(JSON.stringify(data));
            let first = {
              label: "选择所有",
              code: "all",
              id:"all-"+obj.id,
              level: obj.level+1,
              includes:childArr
            }
            for(let i in data){
              data[i].level = obj.level+1;
            }
            data.unshift(first)
            obj.children = data;
          }
        });
      }
    },
    //行业代码-树懒加载数据
    tradeCodeTreeLoadNode(obj, node, resolve) {
      let that = this;
      if (!obj.children[0].hasOwnProperty("id")) {
        //防止重复请求子节点
        let req = {
          mid: obj.mid,
          vid: obj.vid,
          parcode: obj.code
        };
        that.getClassifiedList(req, function(data) {
          if(data.length>0){
            let childArr = JSON.parse(JSON.stringify(data));
            var ran = Math.floor((Math.random()*1000)+1);//介于 1 到 1000 之间的一个随机数
            let first = {
              label: "选择所有",
              code: "all",
              id:"all-"+ran,
              level: obj.level + 1,
              includes:childArr
            }
            for(let i in data){
              data[i].level = obj.level+1;
            }
            data.unshift(first);
            obj.children = data;
          }
        });
      }
    },
    //行业代码-树选中项改变
    tradeCodeTreeCheckChange(obj, checked, indeterminate){
      const that = this;
      if (checked) {
        if(obj.code == "all"){//选择所有
          for(let i in obj.includes){
            that.$refs.tradeCodeTree.setChecked(obj.includes[i],true,false)
          }
        }

        let checkArr = that.$refs.tradeCodeTree.getCheckedNodes();//防止切换造成没有数据，不能及时判断是否是同一级别
        if (checkArr.length) {
          checkArr.map(item => {
            if (item.level != obj.level) {
              that.$refs.tradeCodeTree.setChecked(item, false, null);
            }
          });
        }
        let checkList = that.$refs.tradeCodeTree.getCheckedNodes();
        that.tradeCode.checkList = checkList;
        that.initClassQueryData();
      } else {
        if(obj.code == "all"){//取消选择所有
          for(let i in obj.includes){
            that.$refs.tradeCodeTree.setChecked(obj.includes[i],false,false)
          }
        }else{

        }

        let checkList = that.$refs.tradeCodeTree.getCheckedNodes();
        that.tradeCode.checkList = checkList;
        that.initClassQueryData();
      }
    },
    //分类查询树选中项改变
    identTreeCheckChange(obj,checked,item, index) {
      let that = this;
      if(checked){
        if(obj.code == "all"){//选择所有
          for(let i in obj.includes){
            that.$refs[item.id][0].setChecked(obj.includes[i],true,false)
          }
        }

        let checkArr = this.$refs[item.id][0].getCheckedNodes();//防止切换造成没有数据，不能及时判断是否是同一级别
        if (checkArr.length) {
          checkArr.map(check => {
            if (check.level != obj.level) {//不是同一级，取消之前选中项
              that.$refs[item.id][0].setChecked(check, false, false);
            }
          });
        }

        let checkList = this.$refs[item.id][0].getCheckedNodes();
        that.classified_query_item[index].checkList = checkList;
        that.tradeCode.selectCode = [];
        if(item.idenAliasCode == "HYDL"){//行业大类更新时更新右边行业门类
          let identid = item.identid;//分组目录id
          for(let i in checkList){
            if(checkList[i].mid == identid){
              that.tradeCode.selectCode.push(checkList[i].code)
            }
          }
          let tradeCodeData = that.tradeCode.data.data;
          let treeData = [];
          for(let j in tradeCodeData){
            if(that.tradeCode.selectCode.includes(tradeCodeData[j].code)){
              tradeCodeData[j].disabled = true;
              tradeCodeData[j].level = that.tradeCode.firstLevel;
              treeData.push(tradeCodeData[j]);
            }
          }
          that.tradeCode.treeData = treeData;
        }
        that.initClassQueryData();
      }else{
        if(obj.code == "all"){//取消选择所有
          for(let i in obj.includes){
            that.$refs[item.id][0].setChecked(obj.includes[i],false,false)
          }
        }else{
          // let checkListArr = this.$refs[item.id][0].getCheckedNodes();
          // for(let i in checkListArr){
          //   if(checkListArr[i].code == "all"){
          //     console.log(checkListArr[i])
          //     that.$refs[item.id][0].setChecked(checkListArr[i],false,false)
          //   }
          // }
        }


        let checkList = this.$refs[item.id][0].getCheckedNodes();
        that.classified_query_item[index].checkList = checkList;
        that.tradeCode.selectCode = [];
        if(item.idenAliasCode == "HYDL"){//行业大类更新时更新右边行业门类
          let identid = item.identid;//分组目录id
          for(let i in checkList){
            if(checkList[i].mid == identid){
              that.tradeCode.selectCode.push(checkList[i].code)
            }
          }
          let tradeCodeData = that.tradeCode.data.data;
          that.tradeCode.treeData = [];
          that.tradeCode.checkList = [];
          for(let j in tradeCodeData){
            if(that.tradeCode.selectCode.includes(tradeCodeData[j].code)){
              tradeCodeData[j].disabled = true;
              tradeCodeData[j].level = that.tradeCode.firstLevel;
              that.tradeCode.treeData.push(tradeCodeData[j]);
            }
          }
        }
        that.initClassQueryData();
      }
    },
    //组装分类查询和行业门类条件
    initClassQueryData() {
      let that = this;
      that.hasaddterm.conditions = [];
      that.collapse.colmainconditions = [];
      that.hasaddterm.mainconditions = [];
      for (let i in that.classified_query_item) {//分类查询条件
        if (that.classified_query_item[i].checkList.length > 0) {
          let checkList = that.classified_query_item[i].checkList;
          let data = that.classified_query_item[i].data;
          let fleldData = that.classified_query_item[i];
          let value = ""; //分组值
          let checkedtext = fleldData.idenName + "  " + "属于" + "  "; //文本
          for (let j in checkList) {
            if(checkList[j].code!="all"){
              checkedtext += checkList[j].name + ",";
              value += checkList[j].code + ",";
            }
          }

          //将字符串中最后一个元素","逗号去掉，
          let value_str =
            value.substring(value.length - 1) == ","
              ? value.substring(0, value.length - 1)
              : value;
          let value_checkedtext =
            checkedtext.substring(checkedtext.length - 1) == ","
              ? checkedtext.substring(0, checkedtext.length - 1)
              : checkedtext;
          let conditions = {
            field: fleldData.idenCode,
            fieldName: fleldData.idenName,
            groupId: fleldData.identid,
            join: "",
            operate: "in",
            value: value_str,
            idenAliasCode: fleldData.idenAliasCode,
            valueName:value_checkedtext
          };
          let mainconditions = conditions;
          mainconditions.valueName = value_checkedtext;
          mainconditions.idenType = 4;
          mainconditions.microid = that.tableObj.selected.id;
          mainconditions.enumName = "属于";
          mainconditions.ismaintable = true;
          if(fleldData.idenAliasCode=="QYKG"){//只要有选中企业控股情况，就传入机构类型属于企业条件（只有别名idenAliasCode不会改变，故用此判断）
            that.addJGLXInQy();
          }
          that.hasaddterm.conditions.push(conditions);
          that.hasaddterm.mainconditions.push(conditions);
          that.collapse.colmainconditions.push(mainconditions);
        }
      }
      let tradeCodeCheckList = that.tradeCode.checkList;
      if(tradeCodeCheckList.length>0){
        let value = ""; //分组值
        let checkedtext = "行业门类  " + "属于" + "  "; //文本
        let value_str = '',value_checkedtext='';
        for(let j in tradeCodeCheckList){//行业门类（行业代码条件组装）
          if(tradeCodeCheckList[j].code!="all"){
            checkedtext += tradeCodeCheckList[j].name + ",";
            value += tradeCodeCheckList[j].code + ",";
          }
        }
        //将字符串中最后一个元素","逗号去掉，
        value_str =
          value.substring(value.length - 1) == ","
            ? value.substring(0, value.length - 1)
            : value;
        value_checkedtext =
          checkedtext.substring(checkedtext.length - 1) == ","
            ? checkedtext.substring(0, checkedtext.length - 1)
            : checkedtext;

        let conditions = {
          field: that.tradeCode.data.idenCode,
          fieldName: "行业门类",
          groupId: that.tradeCode.data.identid,
          join: "",
          operate: "in",
          value: value_str,
          idenAliasCode: that.tradeCode.data.idenAliasCode,
          valueName:value_checkedtext
        };
        let mainconditions = conditions;
        mainconditions.valueName = value_checkedtext;
        mainconditions.idenType = 4;
        mainconditions.microid = that.tableObj.selected.id;
        mainconditions.enumName = "属于";
        mainconditions.ismaintable = true;
        that.hasaddterm.conditions.push(conditions);
        that.hasaddterm.mainconditions.push(conditions);
        that.collapse.colmainconditions.push(mainconditions);
      }
    },
    //组装机构类型属于企业条件
    addJGLXInQy(){
      let that = this;
      for (let i in that.classified_query_item) {//分类查询条件
        let fleldData = that.classified_query_item[i];
        if(that.classified_query_item[i].idenAliasCode == "JGLX"){
          let conditions = {
            field: fleldData.idenCode,
            fieldName: fleldData.idenName,
            groupId: fleldData.identid,
            join: "",
            operate: "in",
            value: 10,
            idenAliasCode: fleldData.idenAliasCode,
            valueName:"机构类型  属于  企业",
            microid:that.tableObj.selected.id,
            ismaintable:true,
            idenType:4,
            enumName:"属于"
          };
          that.hasaddterm.conditions.push(conditions);
        }
         
      }
    },
    //分类查询
    classifiedQueryData() {
      this.initClassQueryData();
      this.search_macro();
    },
    //收藏条件单击
    searchlisthander_click(item){
      let that = this;
      this.status.isdb = false;
      let timeout = setTimeout(function() {//解决单击双击冲突问题
        if(that.status.isdb != true){
          that.searchlisthander(item);
        }
      }, 500)
    },
    //收藏条件双击
    searchlisthander_dblclick(item){
      this.status.isdb = true;
      this.searchlisthander(item);
    },
    //模糊查询常用搜索条件点击事件
    searchlisthander(item) {
      this.$store.commit("changeshowmacroqueryall", false);
      this.getAchievementById(item.id);
    },
    //基层成果/条件详细信息查询
    getAchievementById(id) {
      let that = this;
      that.$store.commit("changeshowChartBtnLayer", true);
      let args = {
        id: id
      };
      microAPI
        .getAchievementInfo(args)
        .then(res => {
          if (res.message == "success") {
            let hasaddterm = res.data;
            let conditions = JSON.parse(hasaddterm.conditions);
            hasaddterm.conditions = conditions;

            that.hasaddterm = hasaddterm;

            that.search_macro();
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    //删除基层收藏条件
    deleteachievement(item, index) {
      let that = this;
      let args = {
        id: item.id
      };
      microAPI
        .deleteAchievement(args)
        .then(res => {
          if (res.message == "success") {
            that.saveTermData.splice(index, 1);
            that.$message({
              message: "删除条件成功",
              type: "success"
            });
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    //快速查询
    searchData() {
      let that = this;
      if (this.quicksearchvalue) {
        let req = {
          keyWord: this.quicksearchvalue,
          microId: that.tableObj.selected.id
        };
        microAPI
          .quickQuery(req)
          .then(res => {
            if (res.message == "success") {
              let data = res.data;
              if (data.length > 0) {
                data.map(item =>{
                  item.valueName = item.fieldName+"  包含  "+item.value;
                  return item;
                })
                that.hasaddterm.conditions = data;
                that.hasaddterm.mainconditions = data;
                that.hasaddterm.msConditions = [];
                this.search_macro();
              }
            }
          })
          .catch(error => {
            console.log(error);
          });
      } else {
        that.hasaddterm.conditions = [];
        that.hasaddterm.msConditions = [];
        that.hasaddterm.mainconditions = [];
        this.search_macro();
      }
    },
    //专业条件查询
    search_macro(hasaddterm) {
      let that = this;
      that.status.isClear = false; //改为可执行查询
      this.$store.commit("changeshowChartBtnLayer", true);
      this.$store.commit("changeshowmacroqueryall", false);
      if (that.regions.regionArr.length == 0) {
        that.$message({
          message: "请先选择区划",
          type: "warning"
        });
        return;
      }
      this.report.selectedValue= {};
      if (this.report.reportvalue == "" || this.report.reportvalue == null) {
        this.$message({
          message: "请先选择报告期",
          type: "warning"
        });
        return;
      }else{
        for(let i in that.report.reportoptions){
          if(that.report.reportoptions[i].allName ==  that.report.reportvalue){
            that.report.selectedValue= that.report.reportoptions[i];
          }
        }
      }

      let periods = [
        {
          reportType: that.report.selectedValue.reportType, //报告期类型
          year: that.report.selectedValue.year, //年
          month: that.report.selectedValue.month //月
        }
      ];
      if (hasaddterm && hasaddterm.hasOwnProperty("conditions")) {
        //查询条件更新
        that.hasaddterm = hasaddterm;
      }

      let microQuery = {
        conditions: that.hasaddterm.conditions,
        msConditions: that.hasaddterm.msConditions,

        isSpecial: "none", //直接如此传
        periods: periods,
        regionType: that.regions.regionCodeType,
        regions: that.regions.regionArr
      };
      let argstable = {
        //左边列表查询条件
        current: 1,
        size: microConfig.table.pagesize,
        microId: that.tableObj.selected.id, //主表id
        microQuery: microQuery
      };

      let args = {
        //基层查询条件
        microid: that.tableObj.selected.id, //主表id
        conditions: that.hasaddterm.conditions,
        msConditions: that.hasaddterm.msConditions,
        mainconditions:that.hasaddterm.mainconditions,
        periods: periods,
        regions: that.regions,
        microName:that.tableObj.selected.name
      };
      this.microsearchargs = args;
      this.status.isHasMicroSearch = true;
      this.$store.commit("changeShowMicroQueryResult", true);
    },

    //高亮选中项
    highLightResLi(id) {
      let self = this;
      this.searchresult.searchresultlistData.map((data, index) => {
        if (data.info.ID == id) {
          self.searchresult.activeitem = index;
        }
      });
    },
    openQueryResult() {
      this.$store.commit("changeshowmacroqueryall", false);
      this.$store.commit("changeShowMicroQueryResult", true);
    },
    //改变结果按钮显隐
    changeMicroSearchStatus(status) {
      this.status.isHasMicroSearch = status;
    }
  },
  watch: {
    hideTableObjTree(val) {
      this.showTableObjTree = false;
      this.$refs.selectTableObj.blur();
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "../css/rule.scss";
.query {
  width: 300px;
  height: 100%;
  box-sizing: border-box;
  // max-height: 900px;
  .tableObj_select_popper {
    height: 200px;
    overflow: auto;
    background-color: #fff;
  }
  .logo {
    float: right;
    height: 60px;
    line-height: 60px;
    width: 50px;
    background-color: $backGroundColor;
    color: $fontColor;
    .icon-hanbao {
      cursor: pointer;
    }
  }
  .title {
    font-size: $fontSizeNav;
    color: $fontColor;
    font-weight: bold;
    text-align: center;
    // height: 70px;
    // line-height: 60px;
    background-color: $backGroundColor;
    box-shadow: 2px 5px 5px rgba(0, 0, 0, 0.3);
    min-height: 60px;
    p {
      line-height: 2;
      padding-top: 14px;
    }
    button {
      position: absolute;
      top: 40px;
      left: 83px;
      padding: 3px 10px;
      background: none;
      color: $fontColor;
      border: 1px solid #ffffff63;
    }
  }
  .content {
    height: calc(100% - 60px);
    overflow: hidden;
    background-color: $backGroundColorDeep;
    color: $normalFontColor;
    box-shadow: 2px 5px 5px rgba(0, 0, 0, 0.3);
    .report-box {
      p {
        float: left;
        line-height: 2;
        font-size: $fontSize;
        margin-right: 3px;
        margin-left: 10px;
      }
      .report_input {
        margin-left: 14px;
      }
      .el-tree {
        height: 200px;
        overflow: auto;
        width: 217px;
        z-index: 99;
        position: absolute;
        margin-left: 73px;
        border: 1px solid #ddd;
        margin-right: 3px;
      }

    }
    .classifiedquert_container {
      margin-left: 10px;
      height: auto;
      overflow: auto;
      max-height: 360px;
      min-height: 100px;
      overflow-x: hidden;
      width: 105%;
      overflow-y: auto;
      ul {
        list-style: none;
        li {
          margin-bottom: 8px;
        }
      }
    }
    .classifiedquery_select {
      height: 40px;
      p {
        float: left;
        line-height: 2;
        font-size: $fontSize;
        margin-right: 3px;
        margin-left: 10px;
      }
      .report_input {
        margin-left: 14px;
      }
      .el-tree {
        height: 200px;
        overflow: auto;
        width: 217px;
        z-index: 99;
        position: absolute;
        margin-left: 73px;
        border: 1px solid #ddd;
        margin-right: 3px;
      }
    }
    .el-tabs {
      .el-tabs__header {
        color: #fff;
      }

      .el-tabs__content {
        background: $backGroundColorDeep;
        .blurryquery {
          //模糊查询
          input {
            background: none;
            color: $normalFontColor;
          }
          input::-webkit-input-placeholder {
            /* WebKit browsers */
            color: $normalFontColor;
          }
          input:-moz-placeholder {
            /* Mozilla Firefox 4 to 18 */
            color: $normalFontColor;
          }
          input::-moz-placeholder {
            /* Mozilla Firefox 19+ */
            color: $normalFontColor;
          }
          input::-ms-input-placeholder {
            /* Internet Explorer 10+ */
            color: $normalFontColor;
          }
          .el-input-group__append {
            background: none;
            border: $leftborderColor;
          }
          .el-input__inner {
            background: none !important;
          }
          .el-input {
            .el-input__inner {
              background: none;
            }
          }
          .searchtitle {
            margin: 10px 0 5px 0;
            font-size: $fontSize;
            line-height: 1.5;
            background: $backGroundColor;
            padding: 7px 10px;
          }
          .searchlist-box {
            height: 55vh;
            ul {
              li {
                font-size: $fontSize;
                line-height: 2;
                cursor: pointer;
                display: inline-block;
                width: 100%;
                p {
                  float: left;
                  cursor: pointer;
                  i {
                    float: left;
                  }
                }
                i {
                  float: right;
                  margin-right: 10px;
                  line-height: 2;
                }
              }
            }
          }
          .handle-btn-box {
            display: inline-block;
            margin-top: 20px;
            button {
              float: left;
              padding: 9px 6px;
            }
          }
        }
        .macroquery {
          .searchtitle {
            margin: 10px 0 5px 0;
            font-size: $fontSize;
            line-height: 1.5;
            background: $backGroundColor;
            padding: 7px 10px;
          }
          .searchlist-box {
            ul {
              li {
                font-size: $fontSize;
                line-height: 2;
                cursor: pointer;
                display: inline-block;
                width: 100%;
                p {
                  float: left;
                  i {
                    float: left;
                  }
                }
                i {
                  float: right;
                  margin-right: 10px;
                  line-height: 2;
                }
              }
            }
          }
        }
      }
    }
    .searchresult-box {
      ul {
        height: 50vh;
        overflow: auto;
        li {
          font-size: $fontSize;
          line-height: 2;
          cursor: pointer;
          display: inline-block;
          width: 100%;
          p {
            float: left;
            padding-left: 10px;
            width: 100%;
          }
          i {
            float: left;
            margin-right: 10px;
            line-height: 2;
          }
        }
        li.active {
          background: #40a2de;
          color: #fff;
        }
        li:hover {
          background: #40a2de;
          color: #fff;
        }
      }
      .el-pagination {
        ul {
          li {
            background: none;
          }
        }
        button:disabled {
          background: none;
        }
      }
      .hander-box {
        display: inline-block;
        padding-top: 10px;
        cursor: pointer;
        div {
          float: left;
          margin: 5px;
          position: relative;
          margin-right: 14px;
          img {
            width: 24px;
            height: auto;
            text-align: center;
            left: 0;
            right: 0;
            position: absolute;
            top: 0;
            bottom: auto;
            margin: auto;
          }
          p {
            font-size: $fontSize;
            margin-top: 26px;
          }
        }
      }
    }
    .pagination-box {
      border-bottom: 1px solid;
    }
  }
  .handle-btn-box {
    button {
      width: auto;
      height: auto;
      float: left;
      letter-spacing: 0px;
    }
  }
}

#classifiedquerySelect {
  background: none;
}
.el-input__inner {
  background: none !important;
}
</style>
<style rel="stylesheet/scss" lang="scss">
@import "../css/rule.scss";
.tableObjPopper {
  display: none;
}
#micro {
  .left {
    .query {
      .tableObjTreePopper {
        border: 1px solid $leftborderColor;
        background: $panelContentBg;
        border-radius: 0 0 4px 4px;
        color: $fontColorW;
        .el-tree-node__content:hover {
          background-color: $colorBackgroundActive;
        }
        .el-tree-node:focus > .el-tree-node__content {
          background-color: $colorBackgroundActive;
        }
      }
      .el-tabs {
        margin: 0;
        .el-tabs__header {
          padding: 10px 0 0 5px;
        }
      }
      .classifiedquery {
        height: calc(100% - 210px);
        position: relative;
        max-height: 700px;
        min-height: 595px;
        .el-button--primary {
          background: rgba(29, 156, 183, 1);
          border: none;
        }
        .el-collapse {
          height: auto;
          overflow: auto;
          max-height: 545px;
          min-height: 350px;
          border-top: 1px solid #ebeef500;
          border-bottom: 1px solid #ebeef500;
        }
        .el-collapse-item__header {
          color: $normalFontColor;
          height: 35px;
          padding-left: 15px;
          background-color: rgba(16, 112, 137, 0);
          border-bottom: 1px solid $listBorderBottom;

          line-height: 36px;
          white-space: nowrap;
          text-overflow: ellipsis;
          display: block;
          width: 90%;
          overflow: hidden;
          position: relative;
          .el-collapse-item__arrow{
            position: absolute;
            right: -10px;
            top: 13px;
          }
        }
        .el-collapse-item__wrap {
          background-color: #fff0;
          border-bottom: 0px solid #ebeef500;
        }
        .classSearchBox {
          position: absolute;
          bottom: 0;
          margin: 0 auto;
          left: 0;
          right: 0;
          top: auto;
          text-align: center;
        }
        .el-collapse-item__content {
          .el-checkbox {
            color: #ffffffc2;
            width: 100%;
            margin-right: 0;
            padding-left: 2px;
          }
        }
        .el-checkbox__inner {
          background: none;
          background-color: #fff0;
        }
      }
      .content {
        box-sizing: border-box;
      }
    }
  }
  .mapboxgl-popup-anchor-bottom {
    z-index:300;
    .mapboxgl-popup-tip {
      border-top-color: $panelContentBg;
    }
  }
  .mapboxgl-popup-anchor-left {
    .mapboxgl-popup-tip {
      border-right-color: $panelContentBg;
    }
  }
  .mapboxgl-popup-content {
    background: $panelContentBg;
    color: $fontColorLimit;
    .popupInfo {
      .title {
        color: $fontColorW;
      }
    }
    .mapboxgl-popup-close-button {
      color: $fontColorLimit;
    }
  }
}
.main-content {
  .left {
    .query {
      .el-tabs {
        margin: 10px 0;
        .el-tabs__header {
          padding: 10px 0 0 5px;
        }
      }
    }
  }
}
.left {
  .query {
    .el-tabs {
      margin: 10px 0;
      .el-tabs__header {
        padding: 10px 0 0 5px;
      }
    }
  }
}
.left {
  .report-box {
    background: rgba(10, 87, 110, 0.5);
    padding: 10px 0;
    .el-select {
      input {
        border: 1px solid $leftborderColor;
        background: none;
        color: $fontColorLimit;
        border-radius: 2px;
      }
    }
    .el-select .el-input.is-disabled .el-input__inner:hover{
      border-color: $leftborderColor;
    }
  }
  .micro-search-input{
    padding: 10px 10px;
    box-sizing: border-box;
    background: rgba(10, 87, 110, 0.5);
    input {
      background: none !important;
      border: 1px solid $leftborderColor;
      color: $fontColorLimit;
      border-radius: 2px 0 0 2px;
    }
    .el-input-group__append {
      border: 1px solid $leftborderColor;
      background:none;
      border-radius: 0 2px 2px 0;
      box-sizing: border-box;
      overflow: hidden;
      display: table-cell;
      position: relative;
      button{
        padding: 0 15px;
        display: inline-block;
        background: #107089;
        box-sizing: border-box;
      }
      .el-icon-search {
        color: #fff;
        font-size: 16px;
        line-height: 36px;
      }
    }
  }
  .el-tabs {
    .el-tabs__header {
      border-bottom: 0px solid #e4e7ed;
      margin: 0;
      background: $backGroundColor;
      padding: 10px 0 0 10px;
      .el-tabs__nav {
        border: 0px solid #e4e7ed;
        color: $normalFontColor !important;
        .el-tabs__item {
          color: $normalFontColor !important;
          border: none;
        }
        .el-tabs__item.is-active {
          color: $fontColor !important;
          background: $backGroundColorDeep;
          border: none;
          border-radius: 4px 4px 0 0;
        }
      }
    }
    .el-tabs__content {
      padding: 15px 10px;
      .searchtitle {
        margin: 10px 0 5px 0;
        font-size: $fontSize;
        line-height: 1.5;
      }
      .searchlist-box {
        ul {
          li {
            font-size: $fontSize;
            line-height: 2;
            cursor: pointer;
            i {
              margin-right: 5px;
            }
          }
        }
      }
      .blurryquery {
        .el-input-group__append {
          background: none;
          border: 1px solid $leftborderColor;
        }
        .el-input__inner {
          background: none !important;
          border: 1px solid $leftborderColor;
          border-radius: 2px;
          color: $normalFontColor;
        }
      }
      .macroquery {
        .el-input-group__append {
          background: none;
          border: 1px solid $leftborderColor;
        }
      }
    }
    #pane-macroquery {
      input {
        background: none !important;
        border: 1px solid $leftborderColor;
        border-radius: 2px;
        color: $fontColorLimit;
      }
      .el-input-group__append {
        .el-icon-search {
          color: $leftborderColor;
        }
      }
    }
  }
}
.report_select_popper.el-select-dropdown {
  border: 1px solid $leftborderColor;
  background: $backGroundColor;
  .el-select-dropdown__item.selected {
    color: $fontColor;
    background: $backGroundColorDeep;
  }
  .el-select-dropdown__item.hover,
  .el-select-dropdown__item:hover {
    background: $backGroundColorDeep;
  }
}
</style>

<style rel="stylesheet/scss" lang="scss">
@import "../css/rule.scss";
#micro {
  .classifiedquery_select {
    p {
      float: left;
      line-height: 2;
      font-size: $fontSize;
      margin-right: 3px;
      margin-left: 10px;
    }
    .el-select {
      float: right;
      margin-left: 0;
      width: 73%;
      #classifiedquerySelect {
        background: none;
      }
    }
  }
  .classifiedquert_container {
    ul {
      li {
        cursor: pointer;
      }
    }
  }
  .classifiedquert_container {
    .classifiedqueryTree {
      background: none;
      color: $fontColorLimit;
      .el-checkbox {
        width: auto !important;
        margin-right: 3px !important;
        padding-left: 2px !important;
      }
      .el-tree-node__content:hover {
        background: none;
      }
      .el-checkbox.is-checked+.el-tree-node__label{
        background: none;
        color: $fontColorActive2;
      }
      .el-checkbox__input.is-checked .el-checkbox__inner,
      .el-checkbox__input.is-indeterminate .el-checkbox__inner {
        background-color: #1d9cb700;
        border-color: $fontColorActive2;
      }
      .el-checkbox__inner::after {
        border: 1px solid $fontColorActive2;
        border-left: 0;
        border-top: 0;
      }
      .el-checkbox__inner:hover{
        border-color: $fontColorActive2;;
      }
      .el-tree-node:focus > .el-tree-node__content {
        background-color: rgba(255, 138, 61, 0);
      }
    }
  }
  .tradeCodeContent {
    height: calc(100% - 210px);
    position: relative;
    max-height: 700px;
    min-height: 595px;
    .classifiedqueryTree {
      background: none;
      color: $fontColorLimit;
      height: auto;
      overflow: auto;
      max-height: 570px;
      min-height: 100px;
      overflow-x: hidden;
      .el-tree-node__label{
        color: $fontColorLimit;
      }
      .el-checkbox {
        width: auto !important;
        margin-right: 3px !important;
        padding-left: 2px !important;
      }
      .el-tree-node__content:hover {
        background: none;
      }
      .is-checked.is-focusable .el-tree-node__content .el-tree-node__label {
        background: none;
      }
      .el-checkbox.is-checked+.el-tree-node__label{
        background: none;
        color: $fontColorActive2;
      }
      .el-checkbox__input.is-checked .el-checkbox__inner,
      .el-checkbox__input.is-indeterminate .el-checkbox__inner {
        background-color: #1d9cb700;
        border-color: $fontColorActive2;
      }
      .el-checkbox__inner::after {
        border: 1px solid $fontColorActive2;
        border-left: 0;
        border-top: 0;
      }
      .el-tree-node:focus > .el-tree-node__content {
        background-color: rgba(255, 138, 61, 0);
      }
      .el-checkbox__inner{
        background-color: #fff0;
      }
      .el-checkbox__inner:hover{
        border: 1px solid $fontColorActive2;
      }
      .el-checkbox.is-disabled{
        display: none;
      }
    }
    .classSearchBox{
      position: absolute;
      bottom: 0;
      margin: 0 auto;
      left: 0;
      right: 0;
      top: auto;
      text-align: center;
      .el-button--primary{
        background: #1d9cb7;
        border: none;
      }
    }
  }
}
</style>
